<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<script src="../../js/mui.min.js"></script>
		<link href="../../css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="../../css/share/common.css" />
		<style>
			body,
			html,
			.mui-content {
				background-color: #fff;
			}
			
			.mui-content {
				position: relative;
				padding-left: 15px;
				padding-right: 15px;
			}
			
			textarea {
				width: 100%;
				line-height: 20px;
				margin-top: 10px;
				margin-bottom: 10px;
				border-bottom: 1px solid #da4453;
				overflow: hidden;
				resize: none;
				font-size: 14px;
			}
			
			span {
				position: absolute;
				line-height: 18px;
				right: 15px;
				bottom: -10px;
				font-size: 0.8em;
			}
			
			i {
				font-style: normal;
				color: #da4453
			}
		</style>
	</head>

	<body onload="check()">
		<header class="mui-bar mui-bar-nav ">
			<a class="mui-icon mui-pull-left mui-icon-left-nav mui-action-back header-left "></a>
			<h1 class="mui-title">个性签名</h1>
			<a class="mui-icon mui-pull-right header-right-text" onclick="save()">确定</a>
		</header>
		<div class="mui-content">
			<textarea oninput="check()" maxlength="30" id="qm"></textarea>
			<span>还可以输入<i id="con">30</i>个字</span>
		</div>
		<script type="text/javascript" src="../../js/localData.js"></script>
		<script>
			var accounts = JSON.parse(readData(localStorage.userInfo));
			var tet = document.getElementById("qm");
			document.getElementById('qm').value = accounts.qianMing;
			var len = 30;
			var content = document.getElementById("con");

			function check() {
				var val = tet.value;
				var num = len - val.length;
				if (val.length > 30)
					return;
				if (content.innerText) {
					content.innerText = num;
				} else {
					content.textContent = num;
				}
			}

			function save() {
				var qm = tet.value;
				accounts['qianMing'] = qm;
				localStorage.userInfo = writeData(JSON.stringify(accounts));
				mui.fire(plus.webview.currentWebview().opener(), "refresh")
				mui.back()
			}
		</script>
	</body>

</html>